<div class="bg-light lter b-b wrapper-md">
  <h1 class="m-n font-thin h3">信号源管理</h1>
</div>
<div class="wrapper-md">
<div class="row">



 <div class="col-sm-12">
  <div class="panel panel-default">
    <div class="panel-heading">
      上传管理
    </div>
    <div  >
   <div class="row">

 <div class="col-sm-12" >
 <div class="panel-heading">




</div>
 </div>


 </div>
     
     <form id ="form" action=""   enctype  = "multipart/form-data" > 


     <input type="file" value ="上传" onChange="readyUpload(this);">

    <button type="submit">submit</button>
     </form>


    
    </div>
  </div>
  </div>

  </div>

</div>


<script type="text/javascript">







function readyUpload(obj){

var file = obj.files[0];
 if (!file) {
          return;
        }

var taskUuid = getUUID();
alert(taskUuid);

 var name =  file.name;
 alert(name);
 var type = file.type;
 alert(type);
 var size = file.size
  alert(size);
 var fileDirectory = obj.value;
 alert(fileDirectory);

 var base64fileDirectory = BASE64.encoder(fileDirectory);
 var fileName = name.split('.')[0];
 var fileExtName = name.split('.')[1];

console.log("uuid:"+taskUuid);
var url = "http://106.14.57.55:8081/uds/upload?AccessToken=AccessTokenString&TaskUuid="+taskUuid +"&FileDirectory="+base64fileDirectory+"=&FileName="+fileName+"&FileExtName=."+fileExtName+"&FileSize="+size+"&FileBeginPos=0&SegmentSize=1024&NotifyUrl=NotifyUrlString"



      $.ajax( {  
                  async : false, //是否异步  
                  cache : false, //是否使用缓存  
                  type : 'post', //请求方式,post  
                  dataType : "get", //数据传输格式  
                  url : url, //请求链接  
                  error : function() {  
                      console.log('亲，网络有点不给力呀！');  
                  },  
                  success : function(data) { 

                  console.log("uuid:"+data);
                  }  
             }); 


console.log(url);




}

</script>